#ifndef F_CLNP_H
#define F_CLNP_H

#include <QObject>
#include <stdlib.h>
#include <stdio.h>
#include "pcap.h"
#include "projectdb.h"
#include "stdafx.h"
#include <QStringList>
#include "F_recvthread.h"

class Clnp : public QObject
{
    Q_OBJECT
public:
    explicit Clnp(QString ethType, QObject *parent = 0);
    ~Clnp();
    int  getNetDevNames(QString *errBuf,
                        QStringList *devNames,
                        QStringList *devDesc,
                        int *devNum);

    int  openNetDev(QString devName, QString *errBuf);
    void Start_CapPcaket();
    void Start_run();
    int  sendPack(char *packBuf, int packSize);
    void closeNetDev(void);

    RecvThread *recvThread;

    bool isOpen(){return (fp == NULL)?false:true;}

private:
    pcap_if_t *alldevs;
    pcap_t *fp;
    QString m_ethProto;

public slots:

};

#endif // CLNP_H
